﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace M3U8下载神器
{
    public class ILock
    {
        object _lock = new object();
        public bool TryEnterLock()
        {
           return Monitor.TryEnter(_lock);
        }
        public bool EnterLock()
        {
            Monitor.Enter(_lock);
            return true;
        }
        public bool IsEntered()
        {
            return Monitor.IsEntered(_lock);
        }
        public void ExitLock()
        {
            Monitor.Exit(_lock);
        }
        public object LockObject => _lock;
    }
}
